﻿using ERP.Domain.CustomerSupplier;
using ERP.Domain.Processs;
using ERP.Domain.Products;
using ERP.Domain.SalesManagement;
using ERP.Domain.Scheduling;
using ERP.Domain.System;
using ERP.Domain.Warehouse;
using ERP.Domain.Warehouse.Allocation;
using ERP.Domain.Workorders;
using ERP.Domain.Workorders.Inventory;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Repository.communal
{
    public class MyDbContext : DbContext
    {
        public MyDbContext(DbContextOptions options) : base(options)
        {

        }
        #region rbac权限管理
        public DbSet<User> User { get; set; }
        public DbSet<UserRole> UserRole { get; set; }
        public DbSet<RolePermission> RolePermission { get; set; }
        public DbSet<Role> Role { get; set; }
        public DbSet<Permission> Permission { get; set; }
        public DbSet<Organize> Organize { get; set; }
        public DbSet<OrganizeType> OrganizeType { get; set; }
        public DbSet<Post> Post { get; set; }
        #endregion

        #region 排班
        public DbSet<Team> Team { get; set; }
        public DbSet<Calendar> Calendar { get; set; }
        public DbSet<Schedule> Schedule { get; set; }
        public DbSet<ScheduleDetail> ScheduleDetail { get; set; }
        public DbSet<Shift> Shift { get; set; }
        public DbSet<TeamMember> TeamMember { get; set; }
        public DbSet<TeamType> TeamType { get; set; }
        #endregion

        #region 客户供应商
        public DbSet<Customer> Customer { get; set; }
        public DbSet<Supplier> Supplier { get; set; }
        #endregion

        #region 采购销售管理
        public DbSet<Verification> Verification { get; set; }
        public DbSet<Contract> Contract { get; set; }
        public DbSet<Procure> Procure { get; set; }
        public DbSet<UnitPrice> UnitPrice { get; set; }
        public DbSet<Sheet> Sheet { get; set; }
        public DbSet<Tiered> Tiered { get; set; }
        public DbSet<Rebuy> Rebuy { get; set; }
        public DbSet<DiscountPlan> DiscountPlan { get; set; }
        public DbSet<Phrase> Phrase { get; set; }
        public DbSet<Sales> Sale { get; set; }
        public DbSet<Management> Management { get; set; }
        #endregion

        #region 库存管理
        public DbSet<InventoryTransaction> InventoryTransaction { get; set; }
        public DbSet<TransferOrder> TransferOrder { get; set; }
        public DbSet<TransferOrderLine> TransferOrderLine { get; set; }
        public DbSet<TransferOutRecord> TransferOutRecord { get; set; }
        public DbSet<TransferInRecord> TransferInRecord { get; set; }
        public DbSet<TransferOpLog> TransferOpLog { get; set; }
        public DbSet<ERP.Domain.Warehouse.Allocation.Inventory> Inventory { get; set; }
        #endregion

        #region 产品物料

        /// <summary>
        /// 产品表
        /// </summary>
        public DbSet<Product> Product { get; set; }

        /// <summary>
        /// BOM信息表
        /// </summary>
        public DbSet<BomInfo> BomInfo { get; set; }

        /// <summary>
        /// BOM版本记录表
        /// </summary>
        public DbSet<BomVersionRecord> BomVersionRecord { get; set; }

        /// <summary>
        /// 物料表
        /// </summary>
        public DbSet<Material> Material { get; set; }

        /// <summary>
        /// 物料结构表
        /// </summary>
        public DbSet<MaterialStructure> MaterialStructure { get; set; }

        /// <summary>
        /// 工序表
        /// </summary>
        public DbSet<Process> Process { get; set; }

        /// <summary>
        /// 工艺路线表
        /// </summary>
        public DbSet<ProcessRoute> ProcessRoute { get; set; }

        /// <summary>
        /// 产品用料表
        /// </summary>
        public DbSet<ProductMaterial> ProductMaterial { get; set; }

        /// <summary>
        /// 产品工艺中间表
        /// </summary>
        public DbSet<ProductProcess> ProcessesProcess { get; set; }


        #endregion

        # region 工序管理
        public DbSet<ProcessType> processtype { get; set; }
        public DbSet<ProcessFlow> processflow { get; set; }
        public DbSet<PSrocess> psrocess { get; set; }
        #endregion

        #region 生产工单管理
        public DbSet<Workorder> workorder { get; set; }
        public DbSet<Good> good { get; set; }
        public DbSet<Saless> saless { get; set; }
        #endregion

        #region 统计报表
        // 出入库存表
        public DbSet<InventoryTransactionWordOrder> InventoryTransactionWordOrders { get; set; }

        // 仓库表
        public DbSet<Warehouse> Warehouses { get; set; }

        // 货品盘点表
        public DbSet<InventoryCheck> InventoryChecks { get; set; }

        // 库存调拨表
        public DbSet<InventoryTransfer> InventoryTransfers { get; set; }

        #endregion


    }
}
